package com.glhtgyxy.biyesheji.Service;

import com.glhtgyxy.biyesheji.Mapper.seeMapper;
import com.glhtgyxy.biyesheji.Pojo.evaluate;
import com.glhtgyxy.biyesheji.Pojo.see;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class seeService {

    @Autowired
    seeMapper mapper;

    public see clicksee(){
        see see = new see();
        see.setUsercount(mapper.usercount());
        see.setMerchantcount(mapper.merchantcount());
        ArrayList<evaluate> starcount = mapper.starcount();
        int sum=0;
        for (int i = 0; i < starcount.size(); i++) {
            sum+=starcount.get(i).getStar();
        }
        see.setStarcount(sum);
        return see;
    }
}
